find all duplicate elements in an array